<script setup>
import { ref } from 'vue'
const items = ref(['Foo','Bar' ])
const itemArrays = ref([{message:'Foo'},{message:'Bar'} ])

const myObject = ref({
  title: 'How to do lists in Vue',
  author: 'Jane Doe',
  publishedAt: '2016-04-10'
})
</script>

<template>
  <li v-for="item in items" :key="item">
    {{item}}
  </li>
  <br>
  <li v-for="(item, index) in itemArrays" :key="item">
    {{ index }} - {{ item.message }}
  </li>
  <br>
  <span>循环对象</span>
  <li v-for="(value, key, index) in myObject" :key="key">
    {{ index }}-- {{ key }}-- {{ value }}
  </li>
  <span>循环顺序</span>
  <li v-for=" i in 3" :key="i">
    当前顺序：{{i}}
  </li>
</template>